#ifndef ENTITYMANAGER_H
#define ENTITYMANAGER_H

#include <QObject>
#include "entity.h"
#include <QTime>

class EntityManager : public QObject
{
    Q_OBJECT

public:
    explicit EntityManager(QObject *parent = nullptr);
    ~EntityManager() override;
    EntityList entities();
    Entity *getEntity(const int& id = -1);
    void addEntity(Entity* entiy);
    void addSubEntity(Entity* entiy);
    void clearEntities();
    void tick(const int& msec);

signals:
    void entityAdded(Entity* entity);
    void entityCleared();

public slots:
    void onEntityDestroyed();

private:
    EntityMap mEntities;
    int mMaxID = -1;
};

#endif // ENTITYMANAGER_H
